package cn.study.luckyapp.user.query;

import cn.study.luckyapp.assembler.UserAssembler;
import cn.study.luckyclient.dto.data.UserVo;
import cn.study.luckydomain.User.UserEntity;
import cn.study.luckydomain.gateway.UserGateway;
import feign.FeignException;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Component;

@Component
@AllArgsConstructor
public class UserOneExe {
    private final UserGateway userGateway;
    public UserVo execute(Long id) {
        UserEntity one = userGateway.one(id);
        UserVo userVo = UserAssembler.toUserVo(one);
        return userVo;
    }
}
